let main = document.querySelector('#main')
window.onload = function (){
ajax({
    url: "http://chst.vip:1234/api/getcoupon",
    success(res) {
        console.log(res.result);
        // let weiArr = res;
        let html = "";
        var rarr=[...res.result];
        console.log(rarr);
        rarr.forEach(item => {
            html += `
            <a href="../pages/couponproduct.html?couponId=${item.couponId}">
            <span class="tp"><img src="${item.couponImg}"/></span>
            <span class="title">${item.couponTitle}</span>
            </a>
            `
        })
        main.innerHTML = html;
    },
})}